<template>
  <section>
    <header id="adminHeader">
      <div class="container">
        <p id="title">管理中心</p>
        <!--
        <ul id="adminNav">
          <li v-for="item in navs" :anavid="item.id" @mousedown="select(item.id)">
            <router-link :to="item.url" :class="{active: selected==item.id}">{{ item.name }}</router-link>
          </li>
          <li anavid="login" @mousedown="select('login')">
            <router-link to="/admin/login" :class="{active: selected=='login'}">登录</router-link>
          </li>
          <li anavid="register" @mousedown="select('register')">
            <router-link to="/admin/register" :class="{active: selected=='register'}">注册</router-link>
          </li>
        </ul>
        -->
      </div>
    </header>
    <router-view/>
    <!--
    <AMatch v-if="selected=='match'||selected==''"></AMatch>
    <Register v-if="selected=='register'"></Register>
    <Login v-if="selected=='login'"></Login>
    -->
  </section>
</template>

<script>

  export default {
    name: 'Header',
    components: {},
    data () {
      return {
        selected: location.hash.split('/').length>2 ? location.hash.split('/')[2] : 'match',
        navs: [
          {id: 'match', name: '比赛', url: '/admin/match'},
          //{id: 'league', name: '联赛', url: '/admin/league'},
          //{id: 'player', name: '球员', url: '/admin/player'},
          //{id: 'login', name: '登录', url: '/admin/login'}
        ],
      }
    },
    computed: {
      
    },
    methods: {
      select(id){
        debugger;
        this.selected = id;
      }
    }
  }
</script>

<style scoped>
  #adminHeader{
    border-bottom: 1px solid #a1a1a1;
    box-shadow: 0px 2px 5px #a1a1a1;
    height: 50px;
    line-height: 50px;
    text-align: left;
  }

  /*******************************************/

  #title{
    display: inline-block;
    width: 80px;
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #1d9af9;
  }

  #adminNav{
    list-style: none;
    display: inline-block;
    width: calc(100% - 84px);
    text-align: right;
  }
  #adminNav > li{
    display: inline-block;
    padding: 0 15px;
  }
  #adminNav > li:last-child{
    padding-right: 0;
  }
  #adminNav > li > a{
    color: #666;
  }
  #adminNav > li > a.active{
    color: #1d9af9;
  }
  #adminNav > li > a:hover{
    color: #1d9af9;
  }
</style>
